#ifndef SOBJC_TYPE_H
#define SOBJC_TYPE_H

#include <sobjc-commons/port.h>
#include <sobjc-commons/str_list.h>
#include "class.h"
#include "node.h"

#define OBJC_CTYPE_CHAR_CODE            'c'
#define OBJC_CTYPE_SHORT_CODE           's'
#define OBJC_CTYPE_INT_CODE             'i'
#define OBJC_CTYPE_LONG_CODE            'l'
#define OBJC_CTYPE_FLOAT_CODE           'f'
#define OBJC_CTYPE_DOUBLE_CODE          'd'
#define OBJC_CTYPE_VOID_CODE            'v'
#define OBJC_CTYPE_ID_CODE              '@'
#define OBJC_CTYPE_CLASS_CODE           '#'
#define OBJC_CTYPE_SEL_CODE             ':'
#define OBJC_CTYPE_SELF_CODE            '$'
#define OBJC_CTYPE_SUPER_CODE           '%'
#define OBJC_CTYPE_UNKNOWN_CODE         '?'

#define OBJC_CTYPE_UNSIGNED_CODE        'u'
#define OBJC_CTYPE_CONST_CODE           'r'
#define OBJC_CTYPE_IN_CODE              'n'
#define OBJC_CTYPE_INOUT_CODE           'N'
#define OBJC_CTYPE_OUT_CODE             'o'
#define OBJC_CTYPE_BYCOPY_CODE          'O'
#define OBJC_CTYPE_BYREF_CODE           'R'
#define OBJC_CTYPE_ONEWAY_CODE          'V'

#define OBJC_CTYPE_PTR_CODE             '^'
#define OBJC_CTYPE_BITFIELD_CODE        'b'
#define OBJC_CTYPE_ARRAY_BEGIN_CODE     '['
#define OBJC_CTYPE_ARRAY_END_CODE       ']'
#define OBJC_CTYPE_STRUCT_BEGIN_CODE    '{'
#define OBJC_CTYPE_STRUCT_END_CODE      '}'
#define OBJC_CTYPE_UNION_BEGIN_CODE     '('
#define OBJC_CTYPE_UNION_END_CODE       ')'
#define OBJC_CTYPE_FUNC_BEGIN_CODE      '<'
#define OBJC_CTYPE_FUNC_END_CODE        '>'

char *objc_ctype_from_node(objc_node_t, objc_class_t);
void objc_encode_ctype(char **, objc_node_t, BOOL, objc_class_t);
objc_class_t objc_class_type_from_node(objc_node_t, BOOL *, objc_class_t);

#endif /* SOBJC_TYPE_H */


